/* Must start Server Program first
**
**********************************/
import processing.net.*; // Network library
import processing.serial.*; // Serial library

Client c1; // Create object from Client class
 
Serial myPort; // Create object from Serial class

void setup() {
  size(200, 200); // Sets window size
  background(204);
  
  myPort = new Serial(this, "COM4", 9600); // Create instance for serial port
  c1 = new Client(this, "192.168.1.104", 12345); // Create instance for network client
  }

void draw(){
  int val = c1.read();
  
 println(val);
  if (c1.available() > 0){ // Send data only when you receive data
    
    myPort.write(int(val));
    
  }

}



  
  


